"MapSetup.exe" explanation. *************************************************************** Contents: KAP, NOS/GEO or NDI to BMP or RLE CONVERSION SCAN-YOUR-OWN CHARTS and MAPS *************************************************************** MapSetup is a companion program to Navpak which is used to define georeference points on scan-your-own charts, and file conversion of BSB, NOS/GEO or NDI format charts to improve their use for navigation. The advantages of converting BSB, NOS/GEO and NDI charts for navigation are explained in the file: "Chart.txt" When using MapSetup with scan-your-own charts, georeference points are digitized with the mouse, and chart records such as sounding datum, are typed in a dialog box. When using MapSetup to convert BSB (.kap), NOS/GEO, or NDI format charts to .bmp or .rle, the script file will be written automatically using the georeference points and chart records contained in the .kap or .geo file. In either case, MapSetup will write a script file of the same name and path as the bitmap file, with the extension: .scr. The script file will load with a bitmap of the same name and setup coordinates, scale, datum shifts, chart info records, and magnetic variation. MapSetup will also generate half size, and quarter size images during conversion, which are used by NavPak-32 for quick scrolling and zooming. MapSetup will plot all the georeference points associated with a chart on the main window, and on the "Area Map" window. The placement of the georeference points on the chart image can be visually checked to verify that the plotted point lands on the intersection of a meridian and parallel. Discrepancies can be easily corrected by redigitizing with MapSetup, after converting to .bmp or .rle format. Before moving or adding points, check the "Chart Records" for any datum shift values, and set to zero. After editing points, and before saving the script file, restore datum shifts to their original values. When datum shift values are present, the chart image should be checked for the datum shift note. If using NavPak without a bitmap chart, a reference point can be digitized and recorded with the screen setup dialog box, as explained in the file: NavPak.txt. ****** KAP, NOS/GEO, or NDI to BMP or RLE CONVERSION ****************** To improve the use of BSB (.kap), NOS/GEO, and NDI format charts for navigation, MapSetup can be used to reduce the resolution and clip off the borders. This speeds up scrolling and displays a much larger area of the chart on the screen. The conversion process also gives you the option to incorporate height units (feet or meters), magnetic variation, and notes in the script file to supplement the info from the source file. In the "Convert" menu, select "KAP or NOS/GEO conversion..." and a dialog box will appear which gives the options of selecting the resolution, and to clip or not clip borders. Clipping off the borders will reduce the image size 20% to 30%, then reducing the resolution to 50% will reduce the remaining image, for a total image size of about 20% of the original chart. If converting from .kap or NOS/GEO to .bmp, the resulting .bmp file will be larger than the original file because the .kap or NOS is highly compressed, and the .bmp isn't. MapSetup has the option of compressing the converted image to .rle format, which is very compact, and loads quickly, but scrolls a little slower than a .bmp image. The converted image will not load if it is over 16mb (uncompressed). Converting at a lower resolution, and clipping the borders will reduce the file size. The largest NOAA chart, unclipped, should result in a file less than 16mb, when saved at 50% resolution. After selecting the resolution and clip options, select the "OK" button and a typical "File Open" dialog box will appear, where the drive, directory, and file name (.kap) can be selected as the source image for conversion. Then a "Save As" dialog box will appear to specify where you want the converted .bmp or .rle and .scr files to go. MapSetup then converts the source file, rewrites the georeference points and places all the important data from the header into a binary script file. The script file will set up the coordinates, datum shift, and "Chart Info" dialog box when the chart is loaded into MapSetup or NavPak. After the source file is converted to a .bmp or .rle file, incorrect points can be moved and additional info can be added to the script file as explained below. ************* SCAN-YOUR-OWN CHARTS and MAPS ******************* SCAN Scan the image using a resolution which will show the desired detail. For most charts, 200 dpi resolution is a good balance between clarity and perspective. Higher resolutions will give better clarity but less perspective and a much larger file size. A scan at 165 dpi will give a big perspective, with some loss of detail, but still useful. Converting charts to monochrome is considered a modification of the data, but the file size will be much smaller and it will load much faster. Since paper charts should be on hand, the color loss is not objectionable. NavPak will also display color and gray scale charts. DESKEW IMAGE FIND SKEW ANGLE After scanning the image, the "Skew..." function in MapSetup can be used to find the skew angle of the scan. To use this measurement function, select a parallel or meridian (grid line) near the center and on the long axis of the chart to minimize any out-of-square distortion. Digitize a point near each end of the grid line, then select "Skew..." from the "Tools" menu. The skew angle given, is in the range of 0 to 45 degrees. If deskewing a chart that was scanned at more than 45 degrees, it may be necessary to add or subtract multiples of 45 degrees (depending on which quadrant north is in) to the result to determine a skew angle in the range of 0 to 360 degrees. This function is in the beta testing phase, and should be used with caution. ANOTHER METHOD TO FIND SKEW ANGLE Use the X,Y coordinates shown on the title bar of MapSetup to count the pixels of misalignment. Using the tangent function and the X,Y coordinates, you can determine the amount in degrees, which your image is skewed. Example: A grid line runs from (0,100) to (1200,95). The triangle to solve is a right triangle 5 x 1200 pixels. Inverse tan(5/1200)=0.23873 degrees. This could be written as tan-1 or arctan. Rotate this image clockwise 0.23873 degrees. SKEW TOLERANCE If the skew angle is less than 0.1 degree, then it is not generally necessary to deskew it. Most commercially available digital charts can be skewed up to 0.1 degree, which is not objectionable if the chart has enough reference points. Use an image processing program to "deskew" your scanned image. Most image editing programs have deskew capability, but some don't. Some charts are out of square. Out of Square is distinctly different from skewed. This discrepancy cannot be corrected, but is normally insignificant if the chart has enough reference points. CALIBRATE IMAGE MapSetup.exe is used to select reference points on the bitmap and enter their coordinates. You can define 96 points on the chart at random locations. The average chart should have about 28 points reasonably spread out. Small fragments of charts need about 4 or 6 points. To record points, open the "Points" dialog box and the "Area Map". When you digitize a point on the bitmap, MapSetup will determine if the point is within 15 pixels of a previously recorded point, or within 15 pixels of a previously recorded meridian or parallel. If any matches are found, they will be shown in the "Points" dialog box. When a matching coordinate is not found, type it in the latitude and longitude boxes and press the "Record" button. This writes the point in the script file. If you digitize and record points along one meridian and one parallel, then all the rest of the points on the chart can be recorded without typing, simply digitize and press the "Record" button. If you digitize and record 2 diagonally opposed points, the coordinates in the title bar will be valid, which will assist in identifying other points. The points can be quickly checked with the "Check" button in the "Points" dialog box. To use this feature, open the "Area Map" and digitize on one of the reference points. This will set the active point in the "Points" dialog box, and show its Lat and Lon. Select the "check" button, and the active point will turn yellow. All points on the same meridian as the active point will turn green, and all points on the same parallel will turn blue. Also check the setup by scrolling around the chart, and comparing the points with the grid on the chart. If you find any mistakes, you can redigitize a point, and press the "Record" button to change it, or it can be deleted. Two comment fields labeled: "Text String 1" and "Text String 2" can be used for info about the chart, and the "Heights" field is used for height units above the water (feet or meters). These text strings will appear in NavPak, in the "Chart Info..."dialog box, when the subject bitmap is loaded. Also the magnetic variation can be set. Variation is not necessarily chart specific, so this should be considered a default setting, which can be changed when using NavPak. Variation is normally received with the NMEA data, however some GPS units may not transmit variation, and if the GPS fails, then a default variation in the chart script file will be important for plotting bearings. Horizontal datum shifts, when known, are given on charts to provide the correction necessary to shift the geodetic datum of the chart to the World Geodetic System. If the GPS is set to the same datum as the chart then the datum shift would be zero. When you're satisfied that the setup info is correct, select "Save Script" from the "File" menu. This will write a new script file of the same name as the bitmap with .scr as its extension. This script file will be placed in the same directory as the bitmap. If a script file already exists, then it will be over-written. Script files can be edited or corrected by loading the bitmap into MapSetup. This will load the script file if it is in the same directory as the bitmap and fill in all the dialog boxes. When satisfied that the setup is correct, then select "Write Script file" to over-write the existing script file on disk. To update the image, you can use Windows Paintbrush, or any other program which supports BMP or RLE formats. The script file format has provisions for future expansion which will be compatible with script files made for previous versions. end of MapSetup.txt